package com.MyInterfaceTest;

import java.util.Scanner;

public class MainT {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请选择发送1或2");
        int a = scanner.nextInt();

        /**
         * 按照传统方法发送消息
         */
        Message x = null;
        if (a == 1) {
            x = new Email();
        } else {
            x=new Sms();
        }
        sendMessage(x);

    }
    static void sendMessage(Message message){
        ;//提供一个方法来发送消息
        System.out.println(message.send("sendMessage",2));
    }


}
